home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 1868 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.8 KB

  1. Path: news.th-darmstadt.de!news!enno
  2. From: enno@inferenzsysteme.informatik.th-darmstadt.de (Enno Sandner)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: locking
  5. Date: 13 Jan 1996 16:25:30 GMT
  6. Organization: Fachbereich Informatik, TH Darmstadt
  7. Distribution: world
  8. Message-ID: <ENNO.96Jan13172530@kitz.inferenzsysteme.informatik.th-darmstadt.de>
  9. References: <4d0j6r$1ri@daphne.ecmwf.int>
  10.     <30F3E9C3.15FB7483@intellektik.informatik.th-darmstadt.de>
  11.     <4d8eu8$phs@gidora.kralizec.net.au>
  12. NNTP-Posting-Host: kitz.intellektik.informatik.th-darmstadt.de
  13. In-reply-to: jon@zeta.org.au's message of 13 Jan 1996 14:17:44 GMT
  14.  
  15. In article <4d8eu8$phs@gidora.kralizec.net.au> jon@zeta.org.au writes:
  16.  
  17.    In <30F3E9C3.15FB7483@intellektik.informatik.th-darmstadt.de>, Enno Sandner <enno@intellektik.informatik.th-darmstadt.de> writes:
  18.    >Baudouin Raoult wrote:
  19.    >
  20.    >I would say the temporary object should be destroyed directly after
  21.    >the invocation of 'bar'.
  22.  
  23.    It is up to the compiler to decide when it is destroyed. According to the (ARM 12.2)
  24.    it must be destroyed by the end of the scope which created it, but it
  25.    is implementation dependent as to when it actually is destroyed. 
  26.    Not knowing exactly when the temporary is destroyed means that 
  27.    it is impossible to make strong assertions about the state of the 
  28.    object referred to by fooH after fooH->bar() returns.
  29.  
  30.    Refer to my articles in comp.lang.c++.moderated on this subject for my 
  31.    other comments about the (non-)safety of this locking technique.
  32.  
  33. According to the DWP (12.2) the temporary gets destroyed (in this situation)
  34. at the end of the 'full-expression'. Thus it gets destructed directly after
  35. the invocation of 'bar'.
  36. Anyway as Wil Evers already pointed out it is currently a bad idea to rely
  37. on that behavior.
  38.  
  39.         Enno
  40.  
  41.  
  42.  
  43.